package com.jixin.dao.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jixin.dao.mapper.JdPayDetailInfoMapper;
import com.jixin.dao.mapper.PayRequestInfoMapper;
import com.jixin.dao.model.JdPayDetailInfo;
import com.jixin.dao.model.PayRequestInfo;
import com.jixin.dao.service.PayInfoService;

@Service
public class PayInfoServiceImpl implements PayInfoService {
	
	@Autowired
	private PayRequestInfoMapper payRequestInfoMapper;
	
	@Autowired
	private JdPayDetailInfoMapper jdPayDetailInfoMapper;
	
	/**
	 * 添加支付请求信息
	 */
	@Override
	public PayRequestInfo addPayRequestInfo(PayRequestInfo payRequestInfo){
		payRequestInfoMapper.insert(payRequestInfo);
		return payRequestInfo;
	}

	/**
	 * 查找支付请求信息
	 */
	@Override
	public PayRequestInfo findPayRequestInfoBy(String orderNo, String payId, Integer payWay) {
		return payRequestInfoMapper.findPayRequestInfoBy(orderNo, payId, payWay);
	}
	
	/**
	 * 添加支付详情信息
	 * @param jdPayDetailInfo
	 */
	@Override
	public JdPayDetailInfo addPayDetailInfo(JdPayDetailInfo jdPayDetailInfo){
		jdPayDetailInfoMapper.insert(jdPayDetailInfo);
		return jdPayDetailInfo;
	}

}
